using System;
using OracleInternal.Common;

namespace OracleInternal.TTC
{
	internal class TTCSessionState : TTCFunction
	{
		internal const long KPDSS_SESSSTATE_APPCONT_ENABLED = 1L;

		internal const long KPDSS_SESSSTATE_STATIC = 2L;

		internal const long KPDSS_SESSSTATE_REQUEST_BEGIN = 4L;

		internal const long KPDSS_SESSSTATE_REQUEST_END = 8L;

		internal const long KPDSS_SESSSTATE_NONREQUEST_CALL = 16L;

		internal const long KWFCSFLAGS_TXNAL = 8L;

		internal const long KWFCSFLAGS_STATIC = 16L;

		internal const long KWFCSFLAGS_AUTO = 32L;

		internal TTCSessionState(MarshallingEngine mEngine)
			: base(mEngine, 176, 0)
		{
			m_ttcCode = 17;
		}

		internal void AddAsPiggyback(long sessStateOpsFlags)
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, (OracleTraceTag)131328, OracleTraceClassName.OracleConnectionImpl, OracleTraceFuncName.AddAsPiggyback);
			}
			try
			{
				m_ttcCode = 17;
				WriteFunctionHeader();
				m_marshallingEngine.MarshalSB8(sessStateOpsFlags);
			}
			catch (Exception)
			{
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, (OracleTraceTag)131584, OracleTraceClassName.OracleConnectionImpl, OracleTraceFuncName.AddAsPiggyback);
				}
			}
		}
	}
}
